- public void Move(GameTime gameTime)
- {
- AutoDeccelerate(gameTime);
-
- Velocity.X = Velocity.X + Acceleration.X * (float) gameTime.ElapsedGameTime.TotalSeconds;
- Velocity.Y = Velocity.Y + Acceleration.Y * (float) gameTime.ElapsedGameTime.TotalSeconds;
-
- if (Velocity.X > MaxVelocity)
- {
- Velocity.X = MaxVelocity;
- }
-
- if (Velocity.X < -MaxVelocity)
- {
- Velocity.X = -MaxVelocity;
- }
-
- if (Velocity.Y > MaxVelocity)
- {
- Velocity.Y = MaxVelocity;
- }
-
- if (Velocity.Y < -MaxVelocity)
- {
- Velocity.Y = -MaxVelocity;
- }
-
- Position.X = Position.X + Velocity.X;
- Position.Y = Position.Y + Velocity.Y;
- }
-
- public void ChangeAngle()
- {
- Angle = (float) Math.Atan2(Velocity.Y, Velocity.X);
- }
-
- public void Draw(SpriteBatch spriteBatch)